import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false
// 引入Vue-router 设置页面title
import router from './router'
router.beforeEach((to, form, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
// 引入公共样式
import './styles/base.scss'
import './styles/common.scss'

// 引入图标字体
import './styles/iconfont/iconfont.css'

// 粒子特效
import VueParticles from 'vue-particles'
Vue.use(VueParticles)

// 引入Element-UI
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

// 注册components文件里的组件
import VComponents from './components/index'
Vue.use(VComponents)

// 注册自定义消息提示
import messageBox from './components/messageBox'
Vue.prototype.$message = messageBox

// 引入Echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

new Vue({
  render: (h) => h(App),
  router,
}).$mount('#app')
